package com.zhangtai.modules.service.contract;


import com.zhangtai.modules.dto.ContractNewDto;
import com.zhangtai.modules.dto.ContractRenewDto;
import com.zhangtai.modules.dto.ContractTerminateDto;
import com.zhangtai.modules.entity.contract.ContractMangerEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-10-20 17:57:00
 */

public interface ContractMangerService {

    @GetMapping("/findContractMangerList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "oid", required = false) String oid,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<ContractMangerEntity> getList(@RequestParam(value = "contractType", required = false) String contractType,
                                             @RequestParam(value = "contractStatus", required = false) Integer contractStatus,
                                             @RequestParam(value = "operateType", required = false) Integer operateType,
                                             @RequestParam(value = "type", required = false) Integer type,
                                             @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                             @RequestParam(value = "jobName", required = false) String jobName,
                                             @RequestParam(value = "unitName", required = false) String unitName,
                                             @RequestParam(value = "hireDate", required = false) Date hireDate,
                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                             @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<ContractNewDto> getNewList(@RequestParam(value = "code", required = false) String code,
                                          @RequestParam(value = "name", required = false) String name,
                                          @RequestParam(value = "jobId", required = false) List<Long> jobId,
                                          @RequestParam(value = "unitId", required = false) List<Long> unitId,
                                          @RequestParam(value = "orgId", required = false) List<Long> orgId,
                                          @RequestParam(value = "hiredate", required = false) String hiredate,
                                          @RequestParam(value = "contractStatus", defaultValue = "1") List<Integer> contractStatus,
                                          @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                          @RequestParam(value = "isApply", required = false) boolean isApply,
                                          @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    List<ContractMangerEntity> getPersonNewList(@RequestParam(value = "code", required = false) String code,
                                                @RequestParam(value = "contractStatus", defaultValue = "1") List<Integer> contractStatus);

    PageResult<ContractRenewDto> getRenewList(@RequestParam(value = "code", required = false) String code,
                                              @RequestParam(value = "name", required = false) String name,
                                              @RequestParam(value = "jobId", required = false) List<Long> jobId,
                                              @RequestParam(value = "unitId", required = false) List<Long> unitId,
                                              @RequestParam(value = "orgId", required = false) List<Long> orgId,
                                              @RequestParam(value = "hiredate", required = false) String hiredate,
                                              @RequestParam(value = "contractStatus", defaultValue = "1") List<Integer> contractStatus,
                                              @RequestParam(value = "status", required = false) Integer status,
                                              @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                              @RequestParam(value = "isApply", required = false) boolean isApply,
                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<ContractTerminateDto> getTerminateList(@RequestParam(value = "code", required = false) String code,
                                                      @RequestParam(value = "name", required = false) String name,
                                                      @RequestParam(value = "orgId", required = false) List<Long> orgId,
                                                      @RequestParam(value = "unitId", required = false) List<Long> unitId,
                                                      @RequestParam(value = "contractType", required = false) Integer contractType,
                                                      @RequestParam(value = "contractTimeType", required = false) Integer contractTimeType,
                                                      @RequestParam(value = "status", required = false) Integer status,
                                                      @RequestParam(value = "operateType", required = false) Integer operateType,
                                                      @RequestParam(value = "endType", required = false) String endType,
                                                      @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                                      @RequestParam(value = "contractStatus", defaultValue = "1") List<Integer> contractStatus,
                                                      @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                      @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    List<ContractMangerEntity> getDrawToCloseList(@RequestParam(value = "date", required = false) String date);

    List<ContractMangerEntity> getDrawToRenewList(@RequestParam(value = "date", required = false) String date);

    @GetMapping("/infoContractManger")
    @ApiOperation(value = "根据id查找")
    ContractMangerEntity getByIdE(@RequestParam("id") Long id);

    ContractMangerEntity getByEsignId(Integer flowId);

    @PostMapping("/saveContractManger")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody ContractMangerEntity entity);

    @PostMapping("/updateContractManger")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody ContractMangerEntity entity);

    @GetMapping("/deleteOneContractManger")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteContractMangers")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

